package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.JobService;


import java.util.Calendar;


public class ClearHistory {
    @Reference
    private JobService jobService;

    public void deleteHistory(){
        Calendar c = Calendar.getInstance();//可以对每个时间域单独修改
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int date = c.get(Calendar.DATE);
        String df=year+"-"+month+"-"+date;
        System.out.println("定时清理历史预约数据开始");
        if (jobService!=null) {
            jobService.selectHistory(df);
        }
        System.out.println("定时清理历史预约数据结束");

    }
}
